<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:template match="/">
        <xsl:apply-templates/>
    </xsl:template>
    <xsl:template match="foods">
        <h2>Danh sách thực phẩm</h2>
        <table border="1" style="width: 100%">
            <tr bgcolor="#9acd32">
                <th>Tên thực phẩm</th>
                <th>Hình ảnh</th>
            </tr>
            <xsl:for-each select="food">
                <tr>
                    <td>
                        <xsl:value-of select="foodName"/>
                    </td>
                    <td>
                        <img alt=""  src="http://localhost:8080/DietPlanning/images/food/{imageURL}" width="60" height="60"
                                             id="{foodID}"
                                             name="{imageURL}"
                                             draggable="true"
                                             ondragstart="drag(event)"/>
                    </td>
                </tr>
            </xsl:for-each>
        </table>
 
    </xsl:template>

</xsl:stylesheet>